**********************************************************************************************************************************************
**********************************************************************************************************************************************
*Replication code for analysis of experimental data in "Segregation and Clustering of Preferences Erode Socially Beneficial Coordination" by
*V. Vasconcelos, S. Constantino, A. Dannenberg, M. Lumkowsky, E. Weber, S. Levin 
**********************************************************************************************************************************************

clear
set more off
cap log close

********************************************************************************

cd ""

use "02_replication_data.dta"

xtset id period

***********************************************************************************
*Table S4. Random-effects probit regression – Influence of information on decisions 
***********************************************************************************

xtprobit choice i.info_partial i.info_biased i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 0, re
margins, dydx(i.info_partial i.info_biased) atmeans post
est sto r1

xtprobit choice i.info_partial i.info_biased i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 1, re
margins, dydx(i.info_partial i.info_biased) atmeans post
est sto r2

xtprobit choice i.info_partial i.info_biased i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q4_try q1 q2 q3 if value == 2, re
margins, dydx(i.info_partial i.info_biased) atmeans post
est sto r3

xtprobit choice i.info_partial i.info_biased i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 3, re
margins, dydx(i.info_partial i.info_biased) atmeans post
est sto r4

xtprobit choice i.info_partial i.info_biased i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 4, re
margins, dydx(i.info_partial i.info_biased) atmeans post
est sto r5

estout  r1 r2 r3 r4 r5,  varwidth(16) cells(b(star fmt(4)) se(par fmt(4))) stats(N, fmt(0 4 4)) starlevel(* 0.10 ** 0.05 *** 0.01)  legend style(fixed) nobase 

************************************************************************************************
*Table S5a. Probit regression - Influence of valuation on decisions in the homogenous treatments
************************************************************************************************

probit choice i.value_2 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 0 | value == 2) & info == 1 
margins, dydx(value_2) atmeans post
est sto r1

probit choice i.value_2 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 1 | value == 2) & info == 1
margins, dydx(value_2) atmeans post
est sto r2

probit choice i.value_1 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q4_try q1 q2 q3 if (value == 0 | value == 1) & info == 1 
margins, dydx(value_1) atmeans post
est sto r3

probit choice i.value_2 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 0 | value == 2) & info == 2
margins, dydx(value_2) atmeans post
est sto r4

probit choice i.value_2 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 1 | value == 2) & info == 2
margins, dydx(value_2 ) atmeans post
est sto r5

probit choice i.value_1 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 0 | value == 1) & info == 2
margins, dydx(value_1) atmeans post
est sto r6

estout  r1 r2 r3 r4 r5 r6, varwidth(16) cells(b(star fmt(4)) se(par fmt(4))) stats(N, fmt(0 4 4)) starlevel(* 0.10 ** 0.05 *** 0.01)  legend style(fixed) nobase 

**************************************************************************************************
*Table S5b. Probit regression - Influence of valuation on decisions in the heterogenous treatments
**************************************************************************************************

probit choice i.value_4 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 3 | value == 4) & info == 1 
margins, dydx(value_4) atmeans post
est sto r7

probit choice i.value_4 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 3 | value == 4) & info == 2
margins, dydx(value_4) atmeans post
est sto r8

probit choice i.value_4 i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if (value == 3 | value == 4) & info == 3 
margins, dydx(value_4) atmeans post
est sto r9

estout r7 r8 r9, varwidth(16) cells(b(star fmt(4)) se(par fmt(4))) stats(N, fmt(0 4 4)) starlevel(* 0.10 ** 0.05 *** 0.01)  legend style(fixed) nobase 

*******************************************************************************
*Table S6. Random-effects regression - Influence of information on expectations
*******************************************************************************

xtreg guess i.info_partial i.info_biased conf i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res  g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 0, re
est sto r1

xtreg guess i.info_partial i.info_biased conf i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 1, re
est sto r2

xtreg guess i.info_partial i.info_biased conf i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 2, re
est sto r3

xtreg guess i.info_partial i.info_biased conf i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 3, re
est sto r4

xtreg guess i.info_partial i.info_biased conf i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 4, re
est sto r5

estout  r1 r2 r3 r4 r5,  varwidth(16) cells(b(star fmt(4)) se(par fmt(4))) stats(N, fmt(0 4 4)) starlevel(* 0.10 ** 0.05 *** 0.01) legend style(fixed) nobase keep(1.info_partial 1.info_biased)

**************************************************************************************************************************************
*Table S7. Random-effects probit regression - Influence of information on decisions with expectations included as explanatory variable
**************************************************************************************************************************************

xtprobit choice i.info_partial i.info_biased c.guess i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 0, re
margins, dydx(i.info_partial i.info_biased guess) atmeans post
est sto r1

xtprobit choice i.info_partial i.info_biased c.guess i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 1, re
margins, dydx(i.info_partial i.info_biased guess) atmeans post 
est sto r2

xtprobit choice i.info_partial i.info_biased c.guess i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q4_try q1 q2 q3 if value == 2, re
margins, dydx(i.info_partial i.info_biased guess) atmeans post
est sto r3

xtprobit choice i.info_partial i.info_biased c.guess i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 3, re
margins, dydx(i.info_partial i.info_biased guess) atmeans post
est sto r4

xtprobit choice i.info_partial i.info_biased c.guess i.seq_2 i.seq_3 i.seq_4 i.seq_5 i.seq_6 i.period_2 i.period_3 age i.sex i.studentstatus i.full i.unempl i.uk_res g_q1_try g_q2_try g_q3_try g_q4_try q1 q2 q3 if value == 4, re
margins, dydx(i.info_partial i.info_biased guess) atmeans post
est sto r5

estout  r1 r2 r3 r4 r5,  varwidth(16) cells(b(star fmt(4)) se(par fmt(4))) stats(N, fmt(0 4 4)) starlevel(* 0.10 ** 0.05 *** 0.01)  legend style(fixed) nobase 

*******************************************************************
*Table S8. Pairwise correlations between expectations and decisions
*******************************************************************

pwcorr choice guess if info==1, sig
pwcorr choice guess if info==1 & value == 0, sig
pwcorr choice guess if info==1 & value == 1, sig
pwcorr choice guess if info==1 & value == 2, sig
pwcorr choice guess if info==1 & value == 3, sig
pwcorr choice guess if info==1 & value == 4, sig

pwcorr choice guess if info==2, sig
pwcorr choice guess if info==2 & value == 0, sig
pwcorr choice guess if info==2 & value == 1, sig
pwcorr choice guess if info==2 & value == 2, sig
pwcorr choice guess if info==2 & value == 3, sig
pwcorr choice guess if info==2 & value == 4, sig

pwcorr choice guess if info==3, sig
pwcorr choice guess if info==3 & value == 0, sig
pwcorr choice guess if info==3 & value == 1, sig
pwcorr choice guess if info==3 & value == 2, sig
pwcorr choice guess if info==3 & value == 3, sig
pwcorr choice guess if info==3 & value == 4, sig

********************************************************************
*Table S9. Pairwise correlations between expectations and confidence
********************************************************************

pwcorr guess conf if info==1, sig
pwcorr guess conf if info==1 & value == 0, sig
pwcorr guess conf if info==1 & value == 1, sig
pwcorr guess conf if info==1 & value == 2, sig
pwcorr guess conf if info==1 & value == 3, sig
pwcorr guess conf if info==1 & value == 4, sig 

pwcorr guess conf if info==2, sig
pwcorr guess conf if info==2 & value == 0, sig
pwcorr guess conf if info==2 & value == 1, sig
pwcorr guess conf if info==2 & value == 2, sig
pwcorr guess conf if info==2 & value == 3, sig
pwcorr guess conf if info==2 & value == 4, sig

pwcorr guess conf if info==3, sig
pwcorr guess conf if info==3 & value == 0, sig
pwcorr guess conf if info==3 & value == 1, sig
pwcorr guess conf if info==3 & value == 2, sig
pwcorr guess conf if info==3 & value == 3, sig
pwcorr guess conf if info==3 & value == 4, sig

********************************************************************************
********************************************************************************
